home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / libsrc~1.z / libsrc~1 / utime.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-12-28  |  548 b   |  32 lines

  1. #include "lib.h"
  2. #include <time.h>
  3.  
  4. #ifdef NULL
  5. #undef NULL
  6. #endif
  7.  
  8. #define NULL  (long *) 0
  9.  
  10. #ifndef __STDC__    /* for __STDC__ pick up proto from <std.h> */
  11. extern long time();
  12. #endif
  13.  
  14. PUBLIC int utime(name, timp)
  15. _CONST char *name;
  16. long timp[2];
  17. {
  18.   if (timp == NULL) {
  19.       register long current_time;
  20.       
  21.       current_time = time(NULL);
  22.       M.m2_l1 = current_time;
  23.       M.m2_l2 = current_time;
  24.   } else {
  25.       M.m2_l1 = timp[0];
  26.       M.m2_l2 = timp[1];
  27.   }
  28.   M.m2_i1 = len(name);
  29.   M.m2_p1 = (char *)name;
  30.   return callx(FS, UTIME);
  31. }
  32.